import { Reactiver } from "./subject";

function handle(param: any) {
    console.log(param)
    return '你好'
}

function handle2(param: any) {
    console.log(param)
    return new Promise(res => {
        setTimeout(() => {
            res('世界')
        }, 2000)
    })
}

function handle3(param: any) {
    console.log(param)
    return '执行完成'
}

new Reactiver(
    handle
)
.prior(() => {
    return '开始执行'
})
.add(handle2)
.add(handle3)
.success(params => {
    console.log(params)
})
.undertake(params => {
    console.log(params)
    return '执行结束'
})

console.log('wecome')